package com.quickcode.threadlocal.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by 张波 on 2019/10/23.
 */
@Configuration
public class FilterBean {

    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        filterRegistrationBean.setFilter(new ThreadFilter());
        filterRegistrationBean.addUrlPatterns("/thread/*");
        return filterRegistrationBean;
    }

}
